#!/bin/bash

if [ $# -lt 2 ];then

echo "请输入两个参数"
	else 
		sum=0
		if [ $1 -lt $2 ];then
			for ((i=$1;i<=$2;i++))
				do
					sum=$[$sum+$i]	
				
				done
				echo $sum
		elif [ $2 -lt $1 ];then
			for ((i=$2;i<=$1;i++))
				do
					sum=$[$sum+$i]	
				
				done
				echo $sum
		else 
			echo $1		
	 	fi			
fi

